# Script to save selected text to a file.
import time
import subprocess
import os
time.sleep(0.25)
notecontent = clipboard.get_selection()
notepath = "/home/tankb51/Documents/clip/"
date = system.exec_command("date +%Y%m%d-%H%M%S")
notename = "note_" + date + ".mkd"
with open(os.path.join(notepath, notename), 'w') as fp:
    fp.write(notecontent)
fp.close()
openfile = "gvim + " + notepath + notename
os.popen(openfile)
